package su.samcom.calc.model.entity;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created with IntelliJ IDEA.
 * User: Владислав
 * Date: 21.11.13
 * Time: 22:22
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "calc_samcom_su.price_strategy")
public class PriceStrategy implements Serializable {

    private static final long serialVersionUID = 1586635013979088085L;
    private Long id;
    private PriceGroup separateCargo;
    private PriceGroup generalCargo;

    @Id
    @SequenceGenerator(name = "price_strategy_gen", sequenceName = "calc_samcom_su.price_strategy_seq", allocationSize = 1)
    @GeneratedValue(generator = "price_strategy_gen", strategy = GenerationType.SEQUENCE)
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "separate_cargo_price_group_id")
    public PriceGroup getSeparateCargo() {
        return separateCargo;
    }

    public void setSeparateCargo(PriceGroup separateCargo) {
        this.separateCargo = separateCargo;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "general_cargo_price_group_id")
    public PriceGroup getGeneralCargo() {
        return generalCargo;
    }

    public void setGeneralCargo(PriceGroup generalCargo) {
        this.generalCargo = generalCargo;
    }
}
